package com.itheima.day01;

import java.util.Random;
import java.util.Scanner;

public class Demo08 {
    public static void main(String[] args) {
        int[] arr = new int[7];
        for (int i = 0; i < arr.length-1; i++) {

            int num = new Random().nextInt(32)+1;

            boolean flag = false;

            for( int j = 0; j< arr.length-1;j++){
                if(num == arr[j] ){
                    flag = true;
                    break;
                }
            }
            if (flag){
                i--;
            }else{
                arr[i] = num;
            }

        }
        for (int i = 0; i < arr.length; i++) {
            System.out.println(arr[i]);
        }
        System.out.println(arr.toString());


    }

}
